{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{<__main__.Ball object at 0x1065fcc18>, <__main__.Ball object at 0x1065dba58>, <__main__.Ball object at 0x1065fcc50>, <__main__.Ball object at 0x1065db978>, <__main__.Ball object at 0x1065dbd30>, <__main__.Ball object at 0x1065fcb70>, <__main__.Ball object at 0x1065fcbe0>}\n"
     ]
    }
   ],
   "source": [
    "class Ball:\n",
    "    def __init__(self, color):\n",
    "        self.color = color     # ボールは色を示す変数（文字列の予定）だけ持つ\n",
    "        \n",
    "bag = set()                    # 袋を一つ作る\n",
    "\n",
    "for i in range(3):             # 赤い玉を3つ加える\n",
    "    bag.add(Ball(\"red\"))\n",
    "for i in range(4):             # 白い玉を4つ加える\n",
    "    bag.add(Ball(\"white\"))\n",
    "    \n",
    "print(bag)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
